<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let goods = {
      name: '小米10青春版',
      num: 100012816024,
      weight: '0.55kg',
      address: '中国大陆'
    }

    // 1.查找  对象名.属性名    对象名[''] or 对象名[""]
    // console.log(goods.name);
    // console.log(goods.num);
    // console.log(goods.weight);
    // console.log(goods.address);

    // 2.改  对象名.属性名=新值
    // goods.name = '华为50pro'
    // console.log(goods.name);

    // 3.新增   对象名.新属性值=新增属性
    // goods.color = 'pink'
    // console.log(goods);

    // 4.删除  delete 对象名.属性名
    // delete goods.weight
    // console.log(goods);


    // 1.修改商品名称为小米10plus
    // goods.name = '小米10plus'

    // 2.添加一个属性color 为pink
    goods.color = 'pink'

    // 3.在页面中打印出每个属性值
    document.write(goods.name)
    document.write(`<br>`)
    document.write(goods.num)
    document.write(`<br>`)
    document.write(goods.weight)
    document.write(`<br>`)
    document.write(goods.address)
    document.write(`<br>`)
    document.write(goods.color)
    document.write(`<br>`)
  </script>
</body>

</html>